package hxy.oxygen.demo.entity;

import java.io.Serializable;

/**
 * @author eric
 * @program oxygen-demo
 * @description
 * @date 2021/10/15
 */
public class BaseResponse<T> implements Serializable {
    String message;
    Integer code;
    T data;

    public BaseResponse(String message, Integer code, T data) {
        this.data = data;
        this.code = code;
        this.message = message;
    }


    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    public static <T> BaseResponse<T> success(T data) {
        return new BaseResponse("成功", 200, data);
    }
}
